<?php

header("Cache-Control: no-cache, must-revalidate"); 
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
require("../config.php");
include_once("functii.php");

$muncitori_minerale = valoare_mysql("SELECT nr FROM unitati WHERE planeta = '".$planeta."' AND tip = '1' AND locatie = 'minerale'");
$muncitori_gaz = valoare_mysql("SELECT nr FROM unitati WHERE planeta = '".$planeta."' AND tip = '1' AND locatie = 'gaz'");

$nivel_rafinarie_gaz = valoare_mysql("SELECT nivel FROM `cladiri` WHERE nume = '2' AND planeta = '$planeta'"); //Nivel depozit rafinarie gaz
$nivel_depozit_minerale = valoare_mysql("SELECT nivel FROM `cladiri` WHERE nume = '12' AND planeta = '$planeta'"); //Nivel depozit gaz
$nivel_uzina_energetica = valoare_mysql("SELECT nivel FROM `cladiri` WHERE nume = '5' AND planeta = '$planeta'"); //Nivel uzina energetica

if ($nivel_depozit_minerale > 0)
 $productie_m_minerale = round(formula_incrementare(10, $nivel_depozit_minerale, '1', ''));
else
 $productie_m_minerale = 0;
 
if ($nivel_rafinarie_gaz > 0)
 $productie_m_gaz = round(formula_incrementare(10, $nivel_rafinarie_gaz, '1', ''));
else
 $productie_m_gaz = 0;
 
if ($nivel_uzina_energetica > 0)
 $productie_energie = round(formula_incrementare(100, $nivel_uzina_energetica, '1', ''));
else
 $productie_energie = 0;

$productie_minerale = $muncitori_minerale * $productie_m_minerale;
$productie_gaz = $muncitori_gaz * $productie_m_gaz;
echo '<table width="150" border="0" class="font_1">
  <tr>
    <td colspan="3">Productie pe ora: </td>
  </tr>
  <tr>
    <td colspan="3">&nbsp;</td>
  </tr>
  <tr>
    <td width="19"><img src="img/res_minerale.gif" alt="Productie minerale" /></td>
    <td width="77">Minerale</td>
    <td width="54">'.$productie_minerale.'</td>
  </tr>
  <tr>
    <td><img src="img/res_gaz.gif" alt="Productie gaz" /></td>
    <td>Gaz</td>
    <td>'.$productie_gaz.'</td>
  </tr>
  <tr>
    <td><img src="img/res_energie.gif" alt="Productie energie" /></td>
    <td>Energie</td>
    <td>'.$productie_energie.'</td>
  </tr>
</table>';

?>